#pragma once
#include "al_BasicAbility.h"
#include "al_ISingleTargeting.h"
//#include "al_IAbilityTarget.h"

namespace ability_types
{

/**
Class:		SingleTargetAbility
Purpose:	Allows access to target IEntity
Usage:		Extend from ability template,
			Over-ride action, create constructor

Template<class t>	target IEntity - child type
**/
template<class t>
class SingleTargetAbility : public ability_types::BasicAbility,public ability_core::ISingleTargeting<t>
{
	t * _targetPtr;

public:
	SingleTargetAbility(std::string name,ability::IAbilityOwner * ownerPtr, int amount, int mpCost,int cooldown)
		:BasicAbility(name,ownerPtr,amount,mpCost,cooldown){_targetPtr = NULL;}
	~SingleTargetAbility(){}
	bool condition()
	{
		bool hasTargets = (getSelectedTarget() != NULL);
		if (!hasTargets){std::cout << "Ability has no target - Cannot cast" <<std::endl;}
		return (hasTargets);
	}

	t * getSelectedTarget(){return _targetPtr;}
	void selectTarget(void * tPtr){_targetPtr = static_cast<t*>(tPtr);}

	virtual void action(){}
};

}